<?php
    require_once dirname(dirname(__FILE__)) . '/shared/config/config.php';
    require_once DOCUMENT_ROOT . DIR_ADMIN_INCLUDE . 'check_admin_login.php';
    require_once DOCUMENT_ROOT . DIR_INCLUDE . 'html_generator.php';
    require_once DOCUMENT_ROOT . DIR_SHARED_API . 'api_industry.php';
    require_once DOCUMENT_ROOT . DIR_SHARED_API . 'api_users.php';
    require_once DOCUMENT_ROOT . DIR_SHARED_LIBRARIES . 'lib_redirect.php';
    $title = 'Admin Panel';
    $success = NULL;
    $error = NULL;

?>

<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->

<html>
<head>
    <?php require_once DOCUMENT_ROOT . DIR_ADMIN_INCLUDE . 'head.php' ?>
    <script type="text/javascript">
        $(document).ready(function() {
            $('.selectpicker').selectpicker();
            
            var balanceAdjustment = new BalanceAdjustment(
                    $('select[name="ddl_username"]'),
                    "<?php echo LINK_ROOT . DIR_AJAX; ?>get_balance_by_user_id.php",
                    $('input[name="txt_balance_number"]'),
                    $('input[name="btn_save"]'),
                    $('input[name="btn_cancel"]'),
                    "<?php echo LINK_ROOT . DIR_AJAX; ?>save_balance_by_user_id.php");
            balanceAdjustment.monitor();
        });
    </script>
</head>
<body>
<?php require_once DOCUMENT_ROOT . DIR_ADMIN_INCLUDE . 'header.php' ?>

<!-- Title -->
<div class="section section-black">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="calltoaction-wrapper">
                    <h3>Balance Adjustment (for testing)</h3>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- End Title -->


<div class="ts-wrapper">
    <!-- Section Form -->
    <div class="section">
        <div class="container">
            <div class="row">
                <div class="col-md-offset-2 col-md-8">
                    <div class="service-wrapper">
                        <div class="text-center ts-title ts-margin-bottom">Balance Adjustment (for testing)</div>
                        <?php show_message($success, $error, 1, 10); ?>
                        <form id="form_insert" name="form_insert" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="POST" class="form-horizontal" role="form">
                            <div class="form-group">
                                <label for="txt_name" class="col-sm-3 control-label">Username <span class="ts-red">*</span></label>

                                <div class="col-sm-8">
                                    <?php
                                    $list = api_users::get_all_users();
                                    ?>
                                    <select class="form-control selectpicker" name="ddl_username">
                                        <?php
                                        foreach ($list as $item) {
                                        ?>
                                        <option value="<?php echo $item['id'] ?>"><?php echo $item['username'] ?></option>
                                        <?php
                                        }
                                        ?>
                                    </select>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label">Balance Number <span class="ts-red">*</span></label>

                                <div class="col-sm-8">
                                    <div class="input-group">
                                        <span class="input-group-addon">$</span>
                                        <input type="text" name="txt_balance_number" class="form-control">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-12">
                                    <input name="btn_save" value="Save" type="button" class="btn btn-default">
                                    <input name="btn_cancel" value="Cancel" type="button" class="btn btn-orange">
                                </div>
                            </div>
                        </form>

                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- End Section Form -->
</div>

<?php require_once DOCUMENT_ROOT . DIR_ADMIN_INCLUDE . 'footer.php' ?>
</body>
</html>